package com.oa.ylms.apps.actions.regulations;

import java.util.List;

import com.oa.ylms.apps.business.regulations.IRegulationCategoryService;
import com.oa.ylms.apps.entity.regulations.RegulationCategoryValue;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class RegulationCategoryAction extends ActionSupport {

	
	
	private IRegulationCategoryService service;
	private List <RegulationCategoryValue> list;
	private int states;
	private String categoryName;
	private int categoryId;
	
	public String execute() {
		try {
			list = service.queryAllCategory();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "show";
	}

	public String queryCategoryById(){
		try{
			service.queryCategoryById(categoryId);
		}catch (Exception e){
			e.printStackTrace();
		}
		return "category";
	}
	
	public String add(){
		
		try{
			service.addRegulationCategory(categoryName, states);
		}catch (Exception e) {
			e.printStackTrace();
		}
		return "add";
	}
	
	public String modify(){
		try{
			
		}catch (Exception e){
			e.printStackTrace();
		}
		return "modify";
	}
	
	public String delete(){
		
		try{
			
		}catch (Exception e){
			e.printStackTrace();
		}
		return "delete";
	}

	
	//
	
	public IRegulationCategoryService getService() {
		return service;
	}

	public void setService(IRegulationCategoryService service) {
		this.service = service;
	}

	public List<RegulationCategoryValue> getList() {
		return list;
	}

	public void setList(List<RegulationCategoryValue> list) {
		this.list = list;
	}

	public int getStates() {
		return states;
	}

	public void setStates(int states) {
		this.states = states;
	}

	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public int getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}
	
	
}
